/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Controllers;

import com.bs.Beans.Setor;
import com.bs.Forms.SetorForm;
import com.bs.extensoesSwing.AbstractGridController;
import com.bs.extensoesSwing.PadraoForm;

/**
 *
 * @author Bone
 */
public class SetorController<E> extends AbstractGridController<Setor> {

    @Override
    public void novo() {
        Setor s = new Setor();
        s.setIdEmpresa(getEntityManager().getEmpresa());
        SetorForm f = new SetorForm(getEntityManager(),s);
        f.setVisible(true);
        if(!f.isCancelado())adicionarALista((Setor)f.getBean());
    }

    @Override
    public void alterar() {
        SetorForm f = new SetorForm(getEntityManager(), getBeanSelecionado(), PadraoForm.ALTERAR);
        f.setVisible(true);
    }
}
